3.1.55 \(\int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx\) [55]

3.1.55.1 Optimal result
3.1.55.2 Mathematica [A] (verified)
3.1.55.3 Rubi [A] (verified)
3.1.55.4 Maple [A] (verified)
3.1.55.5 Fricas [A] (verification not implemented)
3.1.55.6 Sympy [F(-1)]
3.1.55.7 Maxima [A] (verification not implemented)
3.1.55.8 Giac [B] (verification not implemented)
3.1.55.9 Mupad [B] (verification not implemented)

3.1.55.1 Optimal result

Integrand size = 28, antiderivative size = 168 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {3 a^2 \text {arctanh}(\sin (c+d x))}{8 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {2 a b \sec ^5(c+d x)}{5 d}+\frac {3 a^2 \sec (c+d x) \tan (c+d x)}{8 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{16 d}+\frac {a^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b^2 \sec ^5(c+d x) \tan (c+d x)}{6 d} \]

output
3/8*a^2*arctanh(sin(d*x+c))/d-1/16*b^2*arctanh(sin(d*x+c))/d+2/5*a*b*sec(d 
*x+c)^5/d+3/8*a^2*sec(d*x+c)*tan(d*x+c)/d-1/16*b^2*sec(d*x+c)*tan(d*x+c)/d 
+1/4*a^2*sec(d*x+c)^3*tan(d*x+c)/d-1/24*b^2*sec(d*x+c)^3*tan(d*x+c)/d+1/6* 
b^2*sec(d*x+c)^5*tan(d*x+c)/d
 
3.1.55.2 Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.00 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {3 a^2 \text {arctanh}(\sin (c+d x))}{8 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {2 a b \sec ^5(c+d x)}{5 d}+\frac {3 a^2 \sec (c+d x) \tan (c+d x)}{8 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{16 d}+\frac {a^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b^2 \sec ^5(c+d x) \tan (c+d x)}{6 d} \]

input
Integrate[Sec[c + d*x]^7*(a*Cos[c + d*x] + b*Sin[c + d*x])^2,x]
 
output
(3*a^2*ArcTanh[Sin[c + d*x]])/(8*d) - (b^2*ArcTanh[Sin[c + d*x]])/(16*d) + 
 (2*a*b*Sec[c + d*x]^5)/(5*d) + (3*a^2*Sec[c + d*x]*Tan[c + d*x])/(8*d) - 
(b^2*Sec[c + d*x]*Tan[c + d*x])/(16*d) + (a^2*Sec[c + d*x]^3*Tan[c + d*x]) 
/(4*d) - (b^2*Sec[c + d*x]^3*Tan[c + d*x])/(24*d) + (b^2*Sec[c + d*x]^5*Ta 
n[c + d*x])/(6*d)
 
3.1.55.3 Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {3042, 3569, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {(a \cos (c+d x)+b \sin (c+d x))^2}{\cos (c+d x)^7}dx\)

\(\Big \downarrow \) 3569

\(\displaystyle \int \left (a^2 \sec ^5(c+d x)+2 a b \tan (c+d x) \sec ^5(c+d x)+b^2 \tan ^2(c+d x) \sec ^5(c+d x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {3 a^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {a^2 \tan (c+d x) \sec ^3(c+d x)}{4 d}+\frac {3 a^2 \tan (c+d x) \sec (c+d x)}{8 d}+\frac {2 a b \sec ^5(c+d x)}{5 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{16 d}+\frac {b^2 \tan (c+d x) \sec ^5(c+d x)}{6 d}-\frac {b^2 \tan (c+d x) \sec ^3(c+d x)}{24 d}-\frac {b^2 \tan (c+d x) \sec (c+d x)}{16 d}\)

input
Int[Sec[c + d*x]^7*(a*Cos[c + d*x] + b*Sin[c + d*x])^2,x]
 
output
(3*a^2*ArcTanh[Sin[c + d*x]])/(8*d) - (b^2*ArcTanh[Sin[c + d*x]])/(16*d) + 
 (2*a*b*Sec[c + d*x]^5)/(5*d) + (3*a^2*Sec[c + d*x]*Tan[c + d*x])/(8*d) - 
(b^2*Sec[c + d*x]*Tan[c + d*x])/(16*d) + (a^2*Sec[c + d*x]^3*Tan[c + d*x]) 
/(4*d) - (b^2*Sec[c + d*x]^3*Tan[c + d*x])/(24*d) + (b^2*Sec[c + d*x]^5*Ta 
n[c + d*x])/(6*d)
 

3.1.55.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3569
Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*si 
n[(c_.) + (d_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*(a 
*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] && Inte 
gerQ[m] && IGtQ[n, 0]
 
3.1.55.4 Maple [A] (verified)

Time = 1.34 (sec) , antiderivative size = 149, normalized size of antiderivative = 0.89

method result size
derivativedivides \(\frac {a^{2} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {2 a b}{5 \cos \left (d x +c \right )^{5}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(149\)
default \(\frac {a^{2} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+\frac {2 a b}{5 \cos \left (d x +c \right )^{5}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}\) \(149\)
parts \(\frac {a^{2} \left (-\left (-\frac {\sec \left (d x +c \right )^{3}}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}+\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{16 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{16}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )}{d}+\frac {2 a b \sec \left (d x +c \right )^{5}}{5 d}\) \(154\)
parallelrisch \(\frac {-1350 \left (\frac {\cos \left (6 d x +6 c \right )}{15}+\frac {2 \cos \left (4 d x +4 c \right )}{5}+\cos \left (2 d x +2 c \right )+\frac {2}{3}\right ) \left (a^{2}-\frac {b^{2}}{6}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+1350 \left (\frac {\cos \left (6 d x +6 c \right )}{15}+\frac {2 \cos \left (4 d x +4 c \right )}{5}+\cos \left (2 d x +2 c \right )+\frac {2}{3}\right ) \left (a^{2}-\frac {b^{2}}{6}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+1440 a b \cos \left (2 d x +2 c \right )+576 a b \cos \left (4 d x +4 c \right )+96 a b \cos \left (6 d x +6 c \right )+\left (1020 a^{2}-170 b^{2}\right ) \sin \left (3 d x +3 c \right )+\left (180 a^{2}-30 b^{2}\right ) \sin \left (5 d x +5 c \right )+\left (840 a^{2}+1140 b^{2}\right ) \sin \left (d x +c \right )+3072 b a \left (\cos \left (d x +c \right )+\frac {5}{16}\right )}{240 d \left (\cos \left (6 d x +6 c \right )+6 \cos \left (4 d x +4 c \right )+15 \cos \left (2 d x +2 c \right )+10\right )}\) \(265\)
risch \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} \left (90 a^{2} {\mathrm e}^{10 i \left (d x +c \right )}-15 b^{2} {\mathrm e}^{10 i \left (d x +c \right )}+510 a^{2} {\mathrm e}^{8 i \left (d x +c \right )}-85 b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+420 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}+570 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+1536 i a b \,{\mathrm e}^{6 i \left (d x +c \right )}-420 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-570 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+1536 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-510 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+85 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-90 a^{2}+15 b^{2}\right )}{120 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}+\frac {3 \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right ) a^{2}}{8 d}-\frac {b^{2} \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{16 d}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{8 d}+\frac {b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{16 d}\) \(319\)
norman \(\frac {\frac {4 a b}{5 d}-\frac {\left (6 a^{2}-281 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{24 d}-\frac {\left (6 a^{2}-281 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{24 d}-\frac {7 \left (6 a^{2}-25 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{24 d}-\frac {7 \left (6 a^{2}-25 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{24 d}+\frac {\left (10 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d}+\frac {\left (10 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{15}}{8 d}+\frac {\left (18 a^{2}+53 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{24 d}+\frac {\left (18 a^{2}+53 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{13}}{24 d}+\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{5 d}-\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{d}-\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}}{d}-\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{14}}{d}-\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{d}+\frac {36 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{5 d}+\frac {36 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{5 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{6} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {\left (6 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{16 d}+\frac {\left (6 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{16 d}\) \(433\)

input
int(sec(d*x+c)^7*(cos(d*x+c)*a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
 
output
1/d*(a^2*(-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c))*tan(d*x+c)+3/8*ln(sec(d*x+c) 
+tan(d*x+c)))+2/5*a*b/cos(d*x+c)^5+b^2*(1/6*sin(d*x+c)^3/cos(d*x+c)^6+1/8* 
sin(d*x+c)^3/cos(d*x+c)^4+1/16*sin(d*x+c)^3/cos(d*x+c)^2+1/16*sin(d*x+c)-1 
/16*ln(sec(d*x+c)+tan(d*x+c))))
 
3.1.55.5 Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 142, normalized size of antiderivative = 0.85 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {15 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 192 \, a b \cos \left (d x + c\right ) + 10 \, {\left (3 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 2 \, {\left (6 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \, b^{2}\right )} \sin \left (d x + c\right )}{480 \, d \cos \left (d x + c\right )^{6}} \]

input
integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="fricas" 
)
 
output
1/480*(15*(6*a^2 - b^2)*cos(d*x + c)^6*log(sin(d*x + c) + 1) - 15*(6*a^2 - 
 b^2)*cos(d*x + c)^6*log(-sin(d*x + c) + 1) + 192*a*b*cos(d*x + c) + 10*(3 
*(6*a^2 - b^2)*cos(d*x + c)^4 + 2*(6*a^2 - b^2)*cos(d*x + c)^2 + 8*b^2)*si 
n(d*x + c))/(d*cos(d*x + c)^6)
 
3.1.55.6 Sympy [F(-1)]

Timed out. \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\text {Timed out} \]

input
integrate(sec(d*x+c)**7*(a*cos(d*x+c)+b*sin(d*x+c))**2,x)
 
output
Timed out
 
3.1.55.7 Maxima [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 180, normalized size of antiderivative = 1.07 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {5 \, b^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 8 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 30 \, a^{2} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {192 \, a b}{\cos \left (d x + c\right )^{5}}}{480 \, d} \]

input
integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="maxima" 
)
 
output
1/480*(5*b^2*(2*(3*sin(d*x + c)^5 - 8*sin(d*x + c)^3 - 3*sin(d*x + c))/(si 
n(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin(d*x + c)^2 - 1) - 3*log(sin(d*x + 
c) + 1) + 3*log(sin(d*x + c) - 1)) - 30*a^2*(2*(3*sin(d*x + c)^3 - 5*sin(d 
*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) 
 + 3*log(sin(d*x + c) - 1)) + 192*a*b/cos(d*x + c)^5)/d
 
3.1.55.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 343 vs. \(2 (152) = 304\).

Time = 0.34 (sec) , antiderivative size = 343, normalized size of antiderivative = 2.04 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {15 \, {\left (6 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 15 \, {\left (6 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} + 15 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 480 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{10} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 235 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 480 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 390 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 960 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 60 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 390 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 960 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 210 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 235 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 96 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 150 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 96 \, a b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{6}}}{240 \, d} \]

input
integrate(sec(d*x+c)^7*(a*cos(d*x+c)+b*sin(d*x+c))^2,x, algorithm="giac")
 
output
1/240*(15*(6*a^2 - b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 15*(6*a^2 - b 
^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(150*a^2*tan(1/2*d*x + 1/2*c)^1 
1 + 15*b^2*tan(1/2*d*x + 1/2*c)^11 - 480*a*b*tan(1/2*d*x + 1/2*c)^10 - 210 
*a^2*tan(1/2*d*x + 1/2*c)^9 + 235*b^2*tan(1/2*d*x + 1/2*c)^9 + 480*a*b*tan 
(1/2*d*x + 1/2*c)^8 + 60*a^2*tan(1/2*d*x + 1/2*c)^7 + 390*b^2*tan(1/2*d*x 
+ 1/2*c)^7 - 960*a*b*tan(1/2*d*x + 1/2*c)^6 + 60*a^2*tan(1/2*d*x + 1/2*c)^ 
5 + 390*b^2*tan(1/2*d*x + 1/2*c)^5 + 960*a*b*tan(1/2*d*x + 1/2*c)^4 - 210* 
a^2*tan(1/2*d*x + 1/2*c)^3 + 235*b^2*tan(1/2*d*x + 1/2*c)^3 - 96*a*b*tan(1 
/2*d*x + 1/2*c)^2 + 150*a^2*tan(1/2*d*x + 1/2*c) + 15*b^2*tan(1/2*d*x + 1/ 
2*c) + 96*a*b)/(tan(1/2*d*x + 1/2*c)^2 - 1)^6)/d
 
3.1.55.9 Mupad [B] (verification not implemented)

Time = 25.04 (sec) , antiderivative size = 328, normalized size of antiderivative = 1.95 \[ \int \sec ^7(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {\left (\frac {5\,a^2}{4}+\frac {b^2}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\left (\frac {47\,b^2}{24}-\frac {7\,a^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+\left (\frac {a^2}{2}+\frac {13\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (\frac {a^2}{2}+\frac {13\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (\frac {47\,b^2}{24}-\frac {7\,a^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{5}+\left (\frac {5\,a^2}{4}+\frac {b^2}{8}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {4\,a\,b}{5}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {3\,a^2}{4}-\frac {b^2}{8}\right )}{d} \]

input
int((a*cos(c + d*x) + b*sin(c + d*x))^2/cos(c + d*x)^7,x)
 
output
((4*a*b)/5 + tan(c/2 + (d*x)/2)^5*(a^2/2 + (13*b^2)/4) + tan(c/2 + (d*x)/2 
)^7*(a^2/2 + (13*b^2)/4) + tan(c/2 + (d*x)/2)^11*((5*a^2)/4 + b^2/8) - tan 
(c/2 + (d*x)/2)^3*((7*a^2)/4 - (47*b^2)/24) - tan(c/2 + (d*x)/2)^9*((7*a^2 
)/4 - (47*b^2)/24) + tan(c/2 + (d*x)/2)*((5*a^2)/4 + b^2/8) - (4*a*b*tan(c 
/2 + (d*x)/2)^2)/5 + 8*a*b*tan(c/2 + (d*x)/2)^4 - 8*a*b*tan(c/2 + (d*x)/2) 
^6 + 4*a*b*tan(c/2 + (d*x)/2)^8 - 4*a*b*tan(c/2 + (d*x)/2)^10)/(d*(15*tan( 
c/2 + (d*x)/2)^4 - 6*tan(c/2 + (d*x)/2)^2 - 20*tan(c/2 + (d*x)/2)^6 + 15*t 
an(c/2 + (d*x)/2)^8 - 6*tan(c/2 + (d*x)/2)^10 + tan(c/2 + (d*x)/2)^12 + 1) 
) + (atanh(tan(c/2 + (d*x)/2))*((3*a^2)/4 - b^2/8))/d